<template>
    <div class="shop_img">

        <div class="box_one " :style="{'backgroundImage': 'url(' + consultImg + ')'}">
<!--            <dl class="shopping_button"><i class="el-icon-goods" style="font-size: 22px;margin-top: 6px"></i></dl>-->
            <dl class="text_button"><p style="padding-top: 15px"><a :href="addressUrl" target="_blank">立即查看</a></p></dl>

        </div>
        <div class="box_two" :style="{'backgroundImage': 'url(' + consultImg2 + ')'}">
<!--            <dl class="shopping_button"><i class="el-icon-goods" style="font-size: 22px;margin-top: 6px"></i></dl>-->
            <dl class="text_button"><p style="padding-top: 15px"><a :href="addressUrl2" target="_blank">立即查看</a></p></dl>

        </div>


    </div>
</template>

<script>
    // import {fangfaming} from '自己创建的js路径'
   import {newConsultApi} from '@/api/ljy_port/newConsult'
    export default {
        name: "index_shopping",
        data(){
            return{
                consultList:[],
                consultImg:'',
                consultImg2:'',
                addressUrl:'#',
                addressUrl2:'#'
            }
        },
     methods:{
         ljy() {
             newConsultApi(1, 2).then(req => {
                 console.log(1)
                 this.consultList=req.data.content
                 this.consultImg = this.consultList[0].news_img;
                 this.consultImg2 = this.consultList[1].news_img;
                 this.addressUrl = this.consultList[0].news_url;
                 this.addressUrl2 = this.consultList[1].news_url;
                 console.log(this.consultList)

             })
         }
     },
        created() {
            this.ljy();
        }
    }
</script>

<style lang="scss" scoped>
    .shop_img{
        width:1200px;
        margin: 0 auto;
        height:680px;
        border: 1px ;
        text-align: center;




        .box_one{
           float: left;
            width:49%;
            height:680px;
            border: 1px ;
            /*background-image: url("imgs/community3.jpg");*/
            background-position: center;
            background-repeat:no-repeat;
            .shopping_button{
                width: 32px;
                height: 32px;
               margin-left: 500px;
                margin-top: 28px;
                background-color:#ffffff;
                opacity:0.8;
            }
            .text_button{
                height: 50px;
                background-color:#ffffff;
                opacity:0.6;
                margin-top: 630px;
            }

        }
        .box_two{
            float: right;
            width:49%;
            height:680px;
            border: 1px ;
            /*background-image: url("imgs/community4.jpg");*/
            background-position: center;
            background-repeat:no-repeat;
            .shopping_button{
                width: 32px;
                height: 32px;
                margin-left: 500px;
                margin-top: 28px;
                background-color:#ffffff;
                opacity:0.8;
            }
            .text_button{
                height: 50px;
                background-color:#ffffff;
                opacity:0.6;
                margin-top:630px;
            }

        }

    }
</style>




